Check for Control-Tab or Control-Shift-Tab, not any Control-key as a
authorOwen Taylor <otaylor@redhat.com>
Mon, 15 Mar 2004 14:57:54 +0000 (14:57 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 15 Mar 2004 14:57:54 +0000 (14:57 +0000)
Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtklabel.c (gtk_label_focus): Check for
        Control-Tab or Control-Shift-Tab, not any Control-key
        as a current event ... handles the case where a dialog
        is triggered from a control accelerator better.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtklabel.c

index bc64c2604911485883c2ae7a28047c28732a8f18..4f4191896cc32fdb14708c0d872565f60e05f11b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_focus): Check for 
+       Control-Tab or Control-Shift-Tab, not any Control-key
+       as a current event ... handles the case where a dialog
+       is triggered from a control accelerator better.
+
 Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
index bc64c2604911485883c2ae7a28047c28732a8f18..4f4191896cc32fdb14708c0d872565f60e05f11b 100644 (file)
@@ -1,3 +1,10 @@
+Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_focus): Check for 
+       Control-Tab or Control-Shift-Tab, not any Control-key
+       as a current event ... handles the case where a dialog
+       is triggered from a control accelerator better.
+
 Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
index bc64c2604911485883c2ae7a28047c28732a8f18..4f4191896cc32fdb14708c0d872565f60e05f11b 100644 (file)
@@ -1,3 +1,10 @@
+Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_focus): Check for 
+       Control-Tab or Control-Shift-Tab, not any Control-key
+       as a current event ... handles the case where a dialog
+       is triggered from a control accelerator better.
+
 Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
index bc64c2604911485883c2ae7a28047c28732a8f18..4f4191896cc32fdb14708c0d872565f60e05f11b 100644 (file)
@@ -1,3 +1,10 @@
+Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_focus): Check for 
+       Control-Tab or Control-Shift-Tab, not any Control-key
+       as a current event ... handles the case where a dialog
+       is triggered from a control accelerator better.
+
 Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
index bc64c2604911485883c2ae7a28047c28732a8f18..4f4191896cc32fdb14708c0d872565f60e05f11b 100644 (file)
@@ -1,3 +1,10 @@
+Mon Mar 15 09:54:36 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklabel.c (gtk_label_focus): Check for 
+       Control-Tab or Control-Shift-Tab, not any Control-key
+       as a current event ... handles the case where a dialog
+       is triggered from a control accelerator better.
+
 Mon Mar 15 08:48:48 2004  Jonathan Blandford  <jrb@gnome.org>
 
        * gtk/gtkfilechooserentry.c (match_selected_callback): implement
index a2fc9b059baa43dbc9d3437891a2ba227592055f..3e9461c9dedba2428f13229c6bde7d7af4f5398d 100644 (file)
@@ -2820,18 +2820,30 @@ gtk_label_focus (GtkWidget         *widget,
                 GtkDirectionType   direction)
 {
   GtkLabel *label = GTK_LABEL (widget);
-  GdkModifierType state;
+  GdkEvent *current_event;
+  gboolean is_control_tab = FALSE;
   
   /* We want to be in the tab chain only if we are selectable
-   * and the Control key is pressed
+   * and Control-[Shift]Tab is pressed
    */
   if (label->select_info == NULL)
     return FALSE;
 
-  if (!gtk_get_current_event_state (&state))
-    return FALSE;
+  current_event = gtk_get_current_event ();
 
-  if (state & GDK_CONTROL_MASK)
+  if (current_event)
+    {
+      if (current_event->type == GDK_KEY_PRESS &&
+         (current_event->key.keyval == GDK_Tab ||
+          current_event->key.keyval == GDK_KP_Tab ||
+          current_event->key.keyval == GDK_ISO_Left_Tab) &&
+         (current_event->key.state & GDK_CONTROL_MASK) != 0)
+       is_control_tab = TRUE;
+      
+      gdk_event_free (current_event);
+    }
+      
+  if (is_control_tab)
     return GTK_WIDGET_CLASS (parent_class)->focus (widget, direction);
   else
     return FALSE;